package com.gdut.wifidemo.data.entity;

public class Wifi {

    private final String ssid;
    private final String bssid;
    private final int rssi;
    private final String venueName;

    private Wifi(Builder builder) {
        ssid = builder.ssid;
        bssid = builder.bssid;
        rssi = builder.rssi;
        venueName = builder.venueName;
    }

    public String getSsid() {
        return ssid;
    }

    public String getBssid() {
        return bssid;
    }

    public int getRssi() {
        return rssi;
    }

    public String getVenueName() {
        return venueName;
    }

    public static class Builder {

        private String ssid = "";
        private String bssid = "";
        private int rssi = 0;
        private String venueName = "";

        public Builder ssid(String ssid) {
            this.ssid = ssid;
            return this;
        }

        public Builder bssid(String bssid) {
            this.bssid = bssid;
            return this;
        }

        public Builder rssi(int rssi) {
            this.rssi = rssi;
            return this;
        }

        public Builder venueName(String name) {
            this.venueName = name;
            return this;
        }

        public Wifi build() {
            return new Wifi(this);
        }

    }

    @Override
    public String toString() {
        if (venueName == null || venueName.isEmpty()) {
            return ssid + "[" + bssid + "]" + "(" + rssi + ")";
        }
        return ssid + "[" + bssid + "]" + "(" + venueName + ")(" + rssi + ")";
    }
}
